added the avail function