added comment and dublicate code removed (define code was repeated)