Added implementation of transform (1st TODO item).