after debugging for logic error; more need to be tested before finish