final version, sack implemented