added to lib scripts + some code snippets