implementing higher order flux calculation