Added comments and removed debugging code.