adding grid and ruler implementation