Changed so that the roll function can be used