just a bit of rearranging and comments