Added questions and constant M. Fixed function for generating hpwd_a