working on final logic...