added post and sorting functionality