Edited 'inf' function