Removed white space at end of lines.
Moved transform function to the states class.
Added an states test class.