nek's solution to pintos-project-2