wrote logic for creating a preconditioner