the if commands for $did 18-21 arewnt checking for state.
needs to be like if ($did(18).state) == 1)
looks kinda cool though