My version

alot like Jonas on the algorithm part, still buggy on import of all
files