example with where , local functions in where and global variable