Cleaned up code. Fixed error for sounds handling