Simplified get_action method. 

In ruby, something like  if action == 1 || 2 is valid, whereas in Java, or many other languages, you'd have to be explicit (i.e. if action ==1 || action ==2).