removed debug, fixed bugs