1st attempt to fix if maxH and maxW are requested