static User check(User user){
		User userChecked=null;
		//Get registered info
		boolean flag=false;//if registered
		List<User> list=new ArrayList<User>();//Store all accounts			
		String infomation="";//Store the content in login.txt
		FileInputStream file=null;
		try {
			file = new FileInputStream("login.txt");
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		byte[] content=new byte[20];				
		while(true){
			int num=0;
			try {
				num = file.read(content);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if(num==-1){
				break;
			}
			String temp=new String(content,0,num);
			infomation+=temp;
		}
		try {
			file.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
		;
		if(infomation.length()==0)
		{
		}
		else
		{String[] accounts=(infomation.substring(0, infomation.length()-1)).split("\n");
		User[] account=new User[accounts.length];
		for(int i=0;i<accounts.length;i++){
			String[] info=accounts[i].split(",");
			account[i]=new User(info[0],info[1]);
		list.add(account[i]);
		}				
		for(User human:list){
			if(user.getName().equals(human.getName())){
				userChecked=human;
			}//Based on username
		}
		
		}//all users info
		
		return userChecked;
	}