Changed slidemaker algorithm