Almost done need to fix some bugs and make sure everything works