Simplify shm function and remove basey assignments