remove unused variable
wrap long lines
use temporary variable to simplify if statement
remove unused variable :  is not used
wrap long lines
improve coding style : remove mixed php and html
cleanup code : remove debug code