A collocation method for boundary value problems