Made changes to the init and clear all method.