Complete pin index functionality, add TODO