Added script and content rendering

Need to review how it works... no good in adding code if you don't know what it does!