Bugfix error + cleaned code