created slimdown python implemenation