removed some debugging code, updated comments