Tidied up arrays, added comments