Added to code to keep player within bounds.