Added first version of findExtrema.m (Not tested!)