modifiedCheckPrefix used instead of checkPrefix, look into the code comments for details, projection funtion modified accordingly