changed return statement back to locals