add reverse polish natation algorithm