variables are now extracted at proper indices and u,v points are correctly extracted