Added Max's changes