Updated implementation section