removed debug code and fixed a slight issue