Cleaned up code, learned alternative syntax and htmlspecialchars