switched from own defined to built-in method