add a flatten method to utilities

this method will flatten a list of irregular lists