iPad Support

Added iPad Support and numerous more changes to code