detecting snake selfhit