adding return statement and minor changes including addition of hungarian notation