Added hp regen, refactored cd library