refactoring, added simple pagination
added back button as directive