Refactors Preassignment Code According to TA Comments