big changes. lots of commmenting also. be careful of bugs.