ticket:1. Modified according to comments