Correctd tests method and prime factor algorithm