Use pop() instead of splice() for better performance