implemented rule of three