Refactored get-indices method in preparation to solve clump finding problem