adding tests - bug fixing - tweaks