removes extra code from walk and marked