tweaking and clean-up - very rough still...