Final Version. Input coded.