added TO-mark, some coment and copied code in 'scala src'