Fix While implementation
Remove redundant code