initial and functional version