implement 'add' and 'commit' halfway