Removed duplicate code and added another example.