Comments and bug fix

Added comments describing what each script does and fixed a bug in the
recommendation engine.