after implementing getLastN in custom queue