changed to arrays, added self executable and comments