Made a few more changes as per elliot.
added more from elliot