Add Exercise 5 Logic

Signed-off-by: Itai Koren <itkoren@gmail.com>