working copy

hard boiled code. messy. re-doing.