Updated code to match sprite location