Implemented Odin's suggested improvements.
Fixed merge conflict.