function analysis step 1 done
cleaned up