test, debug, done. TODO: remove debug couts