made some changes to order of scripts