reformat
simplify plotting function
simplify and reformat code
formatting and simplification of code