The first function is working as expecting according to question and spec