major code cleanup
make this work