changed method to take numbers with period or no period into account