Added warning for unstable status.
Formatted indentation.
Simplified some if else logic.