fixed many things in mud_prog.c