moving everything into functions.