Added fitting functions based on matteobox