worked on logic of code