Add posts method into main