Finalized DMD/POP calculations, created combined function