changed list in sample() from ArrayList to FunctionalLinkedList