Bad function
Updated tests
Function that works