seems to work; removing debug lines