full iOS support

yet cleaner code
iOS actually works now