Fixed grinder program bug