#16 partial implementation, #17 fixed.