Replaced 20 if clauses to 1 if clause. The 3rd condition of noise is completed