Unused local variables should be removed and min()/max()