added pagination
fixed merge conflicts
bad hack to get working