started work on logic which will handle rules