rough and dirty but functionally complete