Added serial code for linear feature detection