some minor changes, added tile size as a constant so it's reusable