added find_index_of_max, everything working fine