Sample code for algorithm study