Added comments and docs