adjusted solution in temporary branch