Pass by value instead of reference wherever possible
Revert "Pass by value instead of reference wherever possible"

This reverts commit 76cbea1fdeee1ca6c2bf5c11cbd820d3f612e21c.
Implemented leastRecentlyUsedSegment