Adding examples and fixing code