changed i in psm to 1-based counting