add first attempt at funtional debugging