Updated to support unpadding