fix tiles, calculate drugmax and drugmin