Added public declarations and removed 'var' for PHP5 style programming