completely redid

code was completely remade. 
php code need to be changed!