added examples and renamed some functions