Code for printFactors added