some cosmatic changes and bug fixes