add Astart of Algorithm and fix bugs before
add Astart and fix bugs