added if else if and else lines.