finished most of js for todos