fixed prototype1
use atomic, d_step
modified dekker's altorigthm