Implementation of a bag using a linked nodes