pagination added and templates updated