update index and test file. add newlog function(incomplete/tests incomplete)