check-in version; needs clean up, comments