tons of changes, ugly but functional basic test code