Replacing if statements with cond since they make things look nicer