implemented old logic i implemented earlier