fixed loops, need to get rid of weird chars