bugfix and algoritm(start)