Fixes, finally working version!