Tidied allmain.c