renamed entities and some smaller bugs
removed trailing spaces