updated to prelim working