started the factorize function
working factorisation with the 3 functions