AFS working example, second attempt