Functionality all restored

All code now in new format, with places working correctly and markers
eing created and removed when needed.