Final code :)