Working code before introduction of GCC and Ratio Test