Added references and removed debugging