multiplication algorithm written down