public HashMap<String,ArrayList<String>> getMessages(String receiver){
		HashMap<String,ArrayList<String>> messages = new HashMap<String,ArrayList<String>>();
		Statement st;
		ResultSet rs;
		String query;
		ArrayList<String> temp = new ArrayList<String>();
		String sender=null;
		String oldsender;

		try {
			st = conn.createStatement();
			query="SELECT sender,message FROM messages WHERE receiver='"+receiver+"' ORDER BY sender ASC" ;
			rs = st.executeQuery(query);
			while (rs.next()){
				oldsender = sender;
				sender=rs.getString(1).trim();
				if(oldsender!=null && !oldsender.equals(sender)){
					messages.put(oldsender, temp);
					temp = new ArrayList<String>();
				}
				temp.add(rs.getString(2));
			}
			rs.close();
			messages.put(sender, temp);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return messages;
	}