(fixed a first half of a problem)
removed debug
(fixed second half)