Using vectors in detection alogrithms