started writing logic