removed debugging code, more comments