Pass 41: use promises to handle asynchronicity