re-wrote dynamic scroll to make it device agnostic