refactored append to clean up if/else and boolean in if 89