useful code segment in work for improving efficience