big commit with lots of changes, sorry future brian...