modifications to make it work