added some js libraries and post sorting logic