Reworked Pdm so that length gets updated #30