Manual merge of #87. Now updated, but better than nothing. Thanks Vexatos! Closes #87