Added cookies & replaced javascript