Update to latest code

Just adding all the updates that have occurred since I made the pull request