initial functional version.