if statements into functions
if statements into functions