add indexation for positions some other changes