final code including parts 80% complete