updated solution as of 3/16 11:24pm