Added a piece of code that removes values from the list when it's size exceeds the limit.