added hmax option