Attempt to optimize scanhash