Java rope implementation