Imp: gived up using simple loop structure using 'while' and started using a recursive function instead as mainloop for waiting commands from the user