Added commented implementations for the interested.