able to compile and run program with single 'end' statement correctly