sampling of code written for fan app