Wrote second test and corresponding code to make it pass. Also refactored code with initialize.