Tidied up the code. Changed IDE and added comments to encourage commenting as the code is being created.