implemented 6D coefficient fitting