implemented writing and reading rectangle based components.