batch import is working, fixed bugs, cleaned up a bit