Refactored Challenge 1 and Completed Challenge 2