MilesObject:Added unit tests and handle bad input