Added WP for results and split out functions