reworked index toolbox scripts with closing overlay and opening side detection