Initial PSTD code