Are the endpoints okay? Implementing Lanczos