finished first version of script