Final Program :)

Now everything works as expected!