Merge with davidbuhler's branch