added else if else structure