First draft of the AFM synthesis algorithm + renaming some packages