Update solution based on prof's comments