Added definition of compact method