working on iOS compatability - not finished