cleaner example pages

included new folders, func and lib for more compartmentalised code