added max(), updated min()