Add in remaining control flow, add misc comments etc