Added support for finding all factors. Also fixed a bug. Refactored the for ...

...loop and the "upto" variable(to match the question). I chose -1 for finding all factors because it's a programming standard. There were also techical difficulties with types when I tried to use a blank string.