debugging version -- ALL good (solved 2 bugs)