Updates to initial and refactored code