reformatted code for cleaner look