added boundary constraints to player