Adds namespaces, fixes while loops, add comparison functions