added expandFile, and some minor stuff