add source export functionality, only files working, buggy source