Sample code of algorithms