added pry, attempted bug fix by subtracting 1