beer4.c tidied up