I realise my mistake. In lines 16 & 17 I dad a goto after the then. Once I removed the 2 goto the program worked fine.