finished work on merging the two versions