working with a "control reaches end of non-void function" warning