Made code a bit more advanced

Created some new functions, added function pointers, and saved some
memory space by changing a lot of ints to shorts