All functions working, now to clean and pretty the code up