broke into functions