implemented fixes to coral generation maths