first stab at Moo port. (TODO: documentation)