grid functionality done