Made several changes as james suggested
Merge