Implemented #12, #13.

Implemented #12, #13.