various modification on graphics and php code