Making code to work as documentation says