More work on getting this to build under iphone. This needs to be re-factored after all this comes together... yuck.