started work on the import function

- also added some much needed commenting throughout