In Grade 2, the older children had a favourite way to scare us. "Wait until you reach Grade 3," they would say. "There is a thing called remainder." They never explained what it was. They didn't need to. The word alone did the work, and for a year we carried a small dread of it, like a teacher we hadn't met yet.
I hadn't thought about that in decades. Then, this year, I watched my son start to struggle with maths, and I ended up building Hesabu Lab, a free 3D math game for kids that makes carrying, borrowing and remainders something a child can see and touch. This is the story of why I built it, what it does, and how it works.
A child who speaks the language of screens#
My son is a creator. He builds contraptions in Algodoo, the 2D physics sandbox, and watches them tumble and spin. He makes animations in Panzoid. He edits his own videos in CapCut, with transitions and effects I would struggle to find. Give him a screen and he is quick, curious and patient.
But arithmetic past ten was starting to slip away from him, and I recognised the look. It was the look of a child being handed rules without being shown the reason.
That contrast was the inspiration. He already understood physics, motion and cause and effect from the tools he loved. He just had never seen maths behave that way. If numbers could fall, stack, burst and fly the way things do in Algodoo, and if every round felt as polished as the videos he edits, maths could be one more world he explores rather than a set of rules he fears.
So I built him that world.
Why carrying, borrowing and remainders feel hard#
My son can count. That was never the issue. The trouble starts when numbers grow past ten and children meet three procedures that feel unrelated:
- Carrying in addition: "write the 2, carry the 1."
- Borrowing in subtraction: "cross out the 4, make it a 3, put a 1 in front."
- Remainders in division: "what's left over goes here."
They look like three separate tricks to memorise. They are really one idea, and that idea is place value: ten ones can be bundled into one ten, and one ten can be broken back into ten ones. Carrying is bundling. Borrowing is unbundling. A remainder is whatever cannot be shared fairly once the bundles have been opened.
Children who struggle are usually doing the steps on paper without ever seeing that exchange happen. So the goal of Hesabu Lab became simple to state: make the exchange visible, physical and impossible to miss.
How Hesabu Lab teaches place value: ten marbles make one crate#
Hesabu Lab ("hesabu" is Swahili for arithmetic) is a 3D factory that runs in any web browser. Marbles are ones. Crates are tens. A glass tube holds exactly ten marbles, and the moment the tenth one drops in, a lid slams down, the marbles squeeze together, and a glowing crate with "10" on its sides bursts out and flies to the tens shelf.

There are four games, one for each operation:
| Game | Example | What the child does | What it teaches |
|---|---|---|---|
| Add | 17 + 5 | Drops marbles until the tube fills and seals into a crate | Carrying: the little "1" appears in the written sum at the exact moment the crate forms |
| Take away | 43 − 7 | Not enough marbles? Opens a crate and ten marbles pour into a ten-frame | Borrowing: the 4 is crossed out, a 3 appears above it and a 1 joins the ones |
| Groups | 4 × 6 | Adds equal groups; every full tube still seals into a crate | Multiplication as equal groups, still built from tens and ones |
| Share | 29 ÷ 4 | Deals marbles to delivery trucks, opens crates when the ones run out, and puts what can't be shared in a leftover tray | Division with remainders |

That last game is the one I built with my Grade 2 self in mind. The remainder is not a monster. It is the marble left in the tray because there were four trucks and only one marble.
What makes it different from a maths quiz#
A maths game can easily become a quiz with decorations. I wanted the opposite: a world where the maths is the mechanics. A few principles guided every decision.
The action and the notation change together. The carried 1 appears the moment the crate is born. The tens digit is crossed out the moment a crate bursts open. The child sees the physical event and the written symbol as the same thing, the bridge from concrete objects to abstract notation that good maths teaching is built on.
Colour means something. Orange is always tens, cyan is always ones, pink is always "taken away" or "left over", in the 3D world and in the written sum alike. Tens sit on the left and ones on the right, just like the digits of a number.
Mistakes get a diagnosis, not just a red cross. When a child answers 17 + 5 = 12, that is not a random error. It is the classic forgotten carry, and the game says so: "Don't forget the crate we made. Count the tens again!" while the crates hop one by one. The same happens for subtracting the smaller digit from the larger one, adding instead of multiplying, or swapping the share and the remainder. Every wrong answer is a clue about what the child is thinking, and the game answers that thought.
It has to be fun first. Children like my son are used to polished games and notice instantly when something is "educational" in the boring sense. So the marbles chime in a rising scale as the tube fills, crates land with a thud and a bounce, trucks drive in on an overhead rail, and correct answers end in confetti. Rounds are short, and each game levels up to bigger numbers after a few wins.
How it is built: Three.js, Rust and WebAssembly, and Blender#
I treated this as a real product, not a weekend toy, because I wanted it to be fast on an ordinary school laptop, free to run, and easy to keep improving.
- Three.js renders the 3D factory, with real-time shadows, a bloom glow pass and particle effects, all in a standard web browser.
- Rapier, a physics engine written in Rust and compiled to WebAssembly, makes the marbles fall, bounce and stack in the tube like real objects, the same kind of physics my son enjoys in Algodoo.
- TypeScript and Vite hold the game together. The maths itself (problem generation and mistake diagnosis) lives in its own pure, unit-tested module, separate from the graphics, so it can be checked on its own and later ported to Rust.
- Blender produced the 3D crate and delivery trucks, but not by hand: each model is generated by a Python script, so every design change is reproducible and versioned like code.
- Sound is synthesised live with the Web Audio API. There are no audio files to download or license.
- Automated play-tests drive a headless browser through a full round of every game, deliberately type the classic wrong answer, check the hint, then answer correctly and capture screenshots.
- GitHub Actions and Cloudflare Pages test every change and deploy it automatically.
One design choice matters more than any other for parents and teachers: everything runs on the child's device. The game is a static site, so there are no accounts, no tracking and no ads, and a whole class can play at the same time without anything to overload.
The result: a few hours to click#
The real test was never going to be a code review. It was my son.
He sat down with it the day it was ready and kept coming back. Within a few hours of play he had the concepts: carrying the ten without being reminded, opening a crate before taking away, and telling me how many marbles each truck got and how many were left over. The same boy who had been slipping on these ideas on paper was now working them out on his own.
That is the moment I had built it for. He did not need the rules repeated more slowly. He needed to see what the rules were describing.
From one child to a classroom#
I built Hesabu Lab for one boy. Then I showed it to a few friends, and the response surprised me. Parents asked whether their children could play it too. They had seen the same struggle at home, and many of them remembered the same playground warnings about remainders.
That changed the project. Hesabu Lab is now:
- Free to play for anyone, at hesabu-lab.pages.dev, in the browser on a phone, tablet or computer.
- Open source under the AGPL-3.0 license, with all the code on GitHub for anyone who wants to learn from it, check how it works, or contribute.
Where the leftover marble leads#
It is easy to file this under "just primary school maths". It isn't. Bundling, unbundling and remainders are the same ideas that run some of the most important technology we use every day. A child who understands the marble in the tray has met them early.
- Place value is how computers count. Ten ones make a ten. In binary, two ones make a "two". Every processor adds numbers with a carry, exactly like the crate sealing, billions of times a second.
- Remainders become clock arithmetic. Three hours after 11 o'clock is 2 o'clock, because 14 shared into twelves leaves 2. Mathematicians call this modular arithmetic: the remainder tray, grown into a whole number system.
- The Remainder Theorem. In secondary school the remainder returns in algebra. Divide a polynomial f(x) by (x − a) and the remainder is simply f(a). The same leftover, now written with letters.
- Check digits. The last digit of an ISBN or a bank card number is chosen using a remainder, so a single mistyped digit is caught before money goes to the wrong account.
- Cryptography. RSA, the encryption that has secured websites and banking for decades, is built on remainders: raise a number to a large power, divide by an enormous number, and keep only what is left over. Easy to do, and practically impossible to undo without the secret key.
- Blockchain. Bitcoin's digital signatures use arithmetic modulo a huge prime number, and its SHA-256 hashing is built from additions that keep only the remainder after dividing by 2³², so any carry past the last place is dropped. Who owns what on the blockchain rests on remainders.
- Machine learning. Here the link is place value. Language models need to know the order of words, and the original Transformer marks each word's position with waves that cycle at different speeds, much like the ones, tens and hundreds of a number, or the hands of a clock, turn at different rates. And when AI models are shrunk to run on a phone, engineers store their numbers with fewer digits, a trade-off that starts with knowing what each digit place is worth.
None of this is in the game, and no child playing it needs to hear it. But it is why the foundation matters. The remainder that frightened us in Grade 2 turns out to guard our bank cards and our blockchains. It deserves a better first impression than a playground rumour.
What I achieved, and what comes next#
The first version does what I set out to do, and the first child to use it learned what it was built to teach. Carrying, borrowing, multiplication and division with remainders are all playable, each grounded in the same picture of ten ones becoming one ten. The game recognises the specific misconception behind a wrong answer and responds to it. It runs smoothly in the browser, costs nothing to use, and is built so it can grow.
There is plenty still to build. The roadmap includes new worlds that keep the same maths but change the scenery, so the game never feels repetitive; saved progress across sessions; hundreds, as pallets of ten crates; and, further ahead, simple insights for parents and teachers about which mistakes a child makes most often, so they know exactly where to help.
Frequently asked questions#
Is Hesabu Lab free?#
Yes. Hesabu Lab is free to play in the browser at hesabu-lab.pages.dev, with no sign-up, no ads and no tracking. The source code is free too, under the AGPL-3.0 open-source license.
What age is Hesabu Lab for?#
It is designed for children around 6 to 9 who can already count and are starting to work with numbers above ten, roughly Grade 2 to Grade 4. Each game starts with smaller numbers and levels up as the child succeeds.
What maths does it teach?#
Place value, through four games: addition with carrying, subtraction with borrowing (regrouping), multiplication as equal groups, and division with remainders, all with numbers up to 99.
How do you explain a remainder to a child?#
Share objects fairly and look at what is left. In Hesabu Lab's Share game, a child deals marbles to delivery trucks one at a time until there are not enough to give every truck another. Those marbles go into the leftover tray, and that is the remainder: 29 marbles shared between 4 trucks gives 7 each, with 1 left over.
Does it need an account or an install?#
No. It runs in a modern web browser on a phone, tablet, laptop or desktop computer. Nothing to install, and no personal data is collected.
The children in my son's class will meet remainders soon. I would like them to meet a marble in a leftover tray before they meet the rumour. Consider it my revenge on the Remainder, decades late and delivered by a six-year-old.
Try it with a child near you at hesabu-lab.pages.dev, and tell me what they think. Feedback from parents and teachers will shape what I build next.
