reworked case statements to support older versions of bash
changed up spacing
cleaned up completion