some problems with the statements and the locals fixed