Removed unnecesary ifs statements