work on AOI calculation