updated array input and output, created a subroutine for variable changing and combined new lines and semi colon remover