Credit Luke for writing the initial version