included maxstat argument in hoa function