implement and fixes #3