script is fully functional. Further changes to output and variablenames needed