adjusted functions to reflect current dir structure; added defmain