Added greedyImproved which uses the math.h function roundf