trying to optimize p2