added end to method in code snippit