cleaned up folder and fixed the end direction line shit

cleaned up folders, moved all functions into their own folder and extracted parts into their own files for organization