added external script, improved performance using abs values around range/2