Fixed bugs

~ replaced critical values with if-constants