Changed Ifs and added Ternary