Fixed some bugs, added ordering. Now import works in 2 steps