working version, minor changes.
will start working on compound component