Fixed infinite loop bug. Edited output.