Function pulleySum