andrew's functionals updated