Complete working co-routine example