in progress - putting into functions