Near completion. Major fixes