re #13 fix #13 added relative_path function and did general cleanup on code