sampling works
working implementation of rmsprop
copy of orhan's original sample function, not backward compatible