Reformat code to be more similar to presentation