added both the approaches