refactoring row methods into loops - not working