Refactors preassignment code According to TA Comments

According to TA comments, I have refactored my code -- and making a pull request from a specific branch.