minor changes, added code commenting