cleaned up code, deleted write.csv and lisread at start of code (now at end of code)