Make p vector a vector of doubles
Add two helper functions last() and lappend(). Add calling of hash package. Minor change to NrParts() function. Convert congugate() and rand_parts1() to R code