Fixed All Bugs in issue 1