Start of new wrapping function, not working as intended