use only max, update tiles/hidden count and use to update dim
updated test