variable name f clarified as 'index'