more style changes and bug fixes