created from petar/GoLLRB