initial commit

Don't even remember what half of this code does