code restructuring and audio fixes/hacks