updated script to include more messages

 also corrected unclosed if and tabbing