Rm216

rebased after the bug fix and created another pull request to avoid conflicts.