Fleshing out JWS; updated functions