working version of jar opening scripts with space discretization