changed function lsWithFlags from bool to void