resolved the missing return statements in functions, haven't tested it yet
added check for missing return statement in function; not tested