removed debugging code and fixed indentation