this is a forked project of MAI to make it better