Add automatic root path detection

this commit fixes #60