moving some code
add a lot of ugly code that gets the job done; lets rewrite in 40 years!