Functions sorted, snippets improved