Refactoring to user double longs instead of biginteger
complete transition of node code