added some comments and console output
fixed some style things