cleaned up + bugfix