Nicer code, clear exit conditions. Fixed passing "false" to insert_posts.