some edits and cleanup