Fixed #1 Usage of a function in loops should be avoided