Put elses after ifs and putted some {}