Optimization of the performance of a thin film permalloy magnetoresistive sensor