My code works but i dont know why?