Issue #18

NOT FULLY TESTED! BE CAREFUL! DO NOT MERGE INTO MASTER (YET)!