I can not see your problem of the code. Why isn't 127 a prime?