fleshed out functional tests