fix debug/rel paths
restructure code