function for signing values