On surfaces with preassigned curvature