final changes and tests