only checking to num/2 for factors