Add compact method in array