Converted entire script to object