Generator function was kinda weird