Fixed issues and added an example.