Pressure is also affected by the volume of the container. If the volume of a container is decreased, the gas molecules have less space in which to move around. As a result, they will strike the walls of the container more often and the pressure of the gas doubles. Increasing the volume of the container would have the opposite effect and the pressure of the gas would decrease.
Hope this helps