Initial attempt at an implementation... partially done.