Moved definitions around, slight redundancy with side, but is ok.