update do @kwood1138 's solution