Removed global variable usage and modified sound conditional to use alternative syntax