some functional code that i will use in my usual work