Implementation of a stack using lists