Add comments and cleanup