A implementation of maximization on Python