Restructure, various fixes.
test code for file