added stack implementation and tests