Inital import of some messy source code