added sorting to post controller
ranking algorithm finished