finally got most of it working