dead code removal; using stack instead of list
reworking core cast reactor