skel copy for reference, somewhat cleaned up