fixed double array and make the program more robust against no tape