solving the prep problem