Reordered lines
Reordered code to be more thourough and to be able to refactor code into IvyInserter
Fixed Ivy Import: need to test still!