here is main controler code called contorl and a working logger code