Added matlab solution for p1