REFACTOR completely!
REFACTOR: Now working completely
BUGFIXES: various!