few modifications to make things work