Update templateWithQueue

Working rev, should be a little refined