made tiles arrange nicely with javascript