Solution to etmc02.c - top ranked so far