Re-wrote the implementation section