Re-added the getConnections method and used ArrayLists instead of Arrays.