extending functionality of wrap method to handle newlines mid string