Working but need to reduce yield loop