C version of MC Go program