Commenting and basics

Commenting code. Fixed some very basic functionality.