What is this magic number -1 here? Would it make sense to make a define/const/macro out of this?