Rewrote all functions

(Due to them being bullshit.)

All functions are now based on integers instead of strings!