major changes. upgraded to phonegap