worked on logic a little