Added function wrappers around code