Final modifications to work like a charm