Revamped for Unity Api 2 compatiblity