Added example 6 and implemented null checker