mostly functional first stab