draft version of full function for one connection