refactoring, added support for fractional numbers