Cleaned up code as per WordPress PHP standards