PSX closes after gaining 844 points