whats the int a at the end for? and thats too many else if statements in my opinion. use a switch case instead. Then again, thats just about style.

tut on switch statements
"If you let your wife stand on your toe tonight, she'll stand on your face tomorrow morning" - Sir/Saint Thomas More