swapped int and double parms in writeAndTest