Update: Making the code compatible. (simple and functional)