Logic Updated

Further updates to logic