flatten out paths and add logging
add some simple tests