How do I loop through entries for a specific entry type? I would like to loop through entries in a channel but only the ones for a specific entry type. Is this Possible?

I'm using the free version of craft on a test site, I have used the channel for my pages but also want to set up a blog. I have set up a blogPost entry type, is there a way to target this in a loop?
{% set entries = craft.entries.section('pages').type('blogPost') %}

{% for entry in entries %}
   {{ entry.title }}
{% endfor %}


Is what I have cobbled together... any pointers on improvements would be welcome.