Added approximation factor. Minor refactoring.