added the optimal solution (un-refactored) to lesson5prob3