changed with Raynes' solution