Add function for markov chains and remove unneccesary import