PSX ends in the green amid volatility