Removed debug print statement
Changed to generator pattern