Working code, fixes to file positioning, can be used as is at this
commit. INcluded all the dependency files.