fixed reassign issue and formatted new code
Merge pull request #63 from bapiraju/K2

fixed reassign issue and formatted new code