Final code added, subject tot change