added fastRank, added error handling for geninv