cleanups and skeleton code for cs