if -1 is a magic number it should maybe be a constant