lots of code refactoring and bug fixes. also added loading/end results table cell