Added 0-1 to array. Also added some error handling for bad input.