Library programming and Serial

Your array is 1024 long and you don't have a mechanism to check out of bound.