changes as requested, some small improvements