Added ability to get negative value of number. Also, some code refactoring.
Some test added.