Fixed some formatting and added post duplicate function