Added 0 and negative handling. And type error handling
Added test() function