rewrite basic functions to accept nil