Updated with all group members' solutions.