assign 2 hw 9 - more optimized