implementing signing in [partial commit]