removed debug printlines, changed tabs to spaces