Pse/working prototype rebased