edits code to be terser