Added unit tests and improved logic for class Number