Made critical changes to underlying structure. Untested