Changed definitions to ifs