added basic WP logic