clean up

removed some excess code
found proper fix to a workaround
cleaned up some of the code