Updated with suggestions from Vik on 2014-07-14