Refactoring

Refactoring functions. Removed dotting for now. Writing up a new DOT
system.