Removed unused references
Changed to writeline instead of write for stdout
Added an additional example