added unittest test for factors function