Fixing mistakes - now works as intended