fixed and restructured roll functions a bit