FIXED THE FOG AND ADDED IF STATEMENTS