updated to work finally