seems to work, removing debug output