another method of solving level3