filling out implementation, changed some type names
MatUtil complete