Added check on CellRec being non-null in addCell()
Make methods static where appropriate.