cleanup and improve std_mult