added support for inputting negative numbers
fixed a slight issue, actually we might need more attention on the negative number part i'm not exactly sure if it's correct