it's working now, should consider using prime factors