substracted one from width so that lines will not break on cygwin etc
made grid agnostic to screen size
fixed bug of cache not accounting for screen size by deleting cache on size change