fixed grid and made lots of other minor changes