Further streamlining of code - still need to name vars properly