Added sprite flipping