Add upper under algorithm