completed #45 - made it compatible with #52