several corrections in marking algorithm
further corrections in marking algorithm