def evaluate(rpn_expr)

        stack = []
        i = 0

        while i < rpn_expr.length do

		# get next element in RPN expression
                rpn_element = rpn_expr[i]

		# try to convert it to an integer using to_i
                # if to_i gives us 0, then it's not an integer
		# since we're only considering non-zero operands
                int_value = rpn_element.to_i    

                if int_value != 0 then
			# TO DO: push the integer on to the stack


                else
                        # pop top two integers off stack
                        a = stack.pop
                        b = stack.pop

                        # if the operator is addition, add and push result on stack
                        if rpn_element == "+"
                                stack.push(a+b)
                        end

			# TO DO: complete other three operators here:





                end

                i = i + 1    # get ready for next RPN element

        end

        return stack.pop     # return result from top of stack

end

