added more if,else to catch invaild input.
still need more