Adding negative number support
Cleaning code