BoundedStack implementation