Updated code so it will now run