Added Arrays and cleaned up code