First implementation if issue #1, #2, #5