Fixed bug when finding factors for 0
Rather slowish solution for problem023