build further fleshed out, alignGraph has been left out until completion