Adding code comments and slightly more optimized code

Next I will make this look more attractive