turned if elses into ternaries