butlast function.