Completed translation. Minor code improvements.