Bug fix : checking length doesn't matter

Length has been modified one step above. Also some indentation changes.