added function wrapping