Test corrected and a single funciton for indexing