add documentation, fix row names
create function, prepare for removing loop