edited 3/4 solution