fixed code due to comments