added references and merged comments