work in progress. switching to clang. adding grid constructor