Simplify method. Fix bug.