Merge in changes to new fork

Originally I just pulled simov's code and was working locally.  Created fork and merging changed code into fork.