Complete Script (to be updated)