public void render(int xScroll, int yScroll){

		remove();//removes all entities that are no longer relevant

		// This will set the screen to not go over the corners of the map
		if (xScroll < 0){xScroll = 0;}
		if (xScroll > (width << 3) - screen.getWidth()){xScroll = (width << 3) - screen.getWidth();}
		if (yScroll < 0) {yScroll = 0;}
		if (yScroll > (height << 3) - screen.getHeight()){yScroll = (height << 3) - screen.getHeight();}
		screen.setOffset(xScroll, yScroll);

		// This will render the entities so that they don't overlap each other.
		for(int i = 0; i < layerEntities.length; i++){
			for(int j = 0; j < layerEntities[i].size(); j++){
				postionRender = (double)layerEntities[i].get(j).getPositionY();

				while (render.containsKey(postionRender)) {
					postionRender = (postionRender + 0.0001);
				}

				render.put(postionRender, layerEntities[i].get(j));
			}

			// Iterate through the list
			set = render.keySet();
			itr = set.iterator();
			while (itr.hasNext()) {
				render.get(itr.next()).render(screen);;
			}

			// Clear up the render list.
			render.clear();

		}
	}