changed setting file location, added tilde expansion function