adding changes from @robertkowalski