made some minor changes, commented a few things, just search for SP