fixed bugs, modified grid