Comments and specs

Added comments to all code and added more dependency definitions.