Updated based on dirk-thomas' feedback