final adjustments for usingn matlabd