final changes

The algorithm can run, but shows not a lot of changes
fixed bug