An improved version of functions on worksheets