setting up and understanding ternaries