J.P. Morgan interview question

implement some basic wrapper function