Factory function in and working

itteration loops working for object types and multiple itterations