some code for my masters research