Working Version!! unsafe code