finally got stuff working mostly