Day 9: Cleaned up code