cleaned up Diamond code