Added first pass code

Added comments and first pass at code