added wrapper function and init functions