Works only with small numbers