added some comments; error = work in progress