Factors affecting biodiversity in coral reefs