A bunch of stuff for demo purposes only. All PHP -- needs to be converted to Java.