implementation of scroll view mimicking UIScrollView