Fixed some bugs in loading the last page and dragging elements. Updated style. Cleaned code.