Rewrote core to support multiple surface problems and multiple component functions