cleaned up code, added pull to refresh and horizontal mode