Changed array program to tell me when error occurs