Modifying PathPoint class getCurrentIndex() method.