ugly commit

lots of horrible code in this commit.. needs refactor