Fixed add method and implemented other methods.