added control for negative and decimal numbers