miscellaneous code snippet, mostly written for some testing purpose