fix algorithm totally not to use eval