Can now obtain root commit
First working implementation of flatten script