minor changes, not debugged