This is the most trivial (but also most efficient) implementation possible. Should be good enough for now.