start breaking things into functions