working version almost finished just need to fix up small logic bugs