a lot of changes made to code and meant to submit my commits earlier