Move the return and the closing bracket to the bottom
Make the chess solutions more readable and concise

I think that the for loop gets the important information together in one
or several  consecutive lines, which is better.