red implementation