reverted to older version, code was slowing down