Updated the entire implementation.