initial version - needs some cleanup.