reformatted min
changed promise to try to get it to work on jsfiddle