Solving issue #6 and #4