Updated regex. Adding in some debugging parts