added some tests; implemented rename; ugly!