FInished post.js. Not tested or debugged yet.