replaced 'sub' keyword with 'def'