Added function to calculate number of tiles out of place relative to goal