blackz:
Was my coding was wrong at which part?
You have not told us what the program actually does, or what you want it to do that is different.
There is an awful lot of repetition in your program that could be eliminated by the use of arrays.
This is almost certainly wrong
else if (Serial.available()> 6)
Serial.available() tells you how many characters are in the serial input buffer. You need to use Serial.read() to get a character. Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.
This Python - Arduino demo may also be of interest.
...R