making a better hoist function