initial version mostly complete