Reworked the tweet writing function