Code Overhaul

Code Overhaul. Code wasn’t functioning the way I expected so after some
debugging I decided to scrap it and rewrite.