fixed some calculations, added json for grid