Added tests and update examples fo AFD