improved max library.