improved python side  of slic