ticket:3. Modified according to comments