implemented large parts of the 'not nil' checking
resolved conflict; added missing files