added convenience functions, cleaned up examples