Now using return codes properly