The functions all work, I have just been cleaning up the code.