logic fixed
incomplete test