Updating code to fit new environment