Reverted back to working version (hopefully)