finally getting the working script
merging