implementing signatures, though not fully tested.