Updated with changes from Rob G