final fixes and modifications