major code for package 2; but it doesnt seem to work right, yet