cleaning code, fixes #6