code for ball mill program in