Added method call and fixed syntax errors