Using undefined rather than 0 for functions to complete