algo for recusrive multiplication