Code adjusted to allow every use-case