Everything works. Just need to clean up the code