much refactoring; broken; adding new fields and tap support