Cleaned up some code and added a bit extra, still much work to be done.