Refactored assignment 3
Refactored assignment 4