Fixed condition in parsing doubles for array so program doesn't crash when input contains enter space in the end