finalized math in between and cleaned up the examples